package com.thoughtworks.preuniversity.biblioteca;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by padmavb on 6/20/14.
 */
public class RegisteredUsers {

    private Map<String,User> registeredUser=new HashMap<String,User>(){{


        put("123-1234",new User("Padma","ppp@gmail.com",1234567890,"PPPPPP"));
        put("123-4567",new User("Latha","lll@gmail.com",1234567891,"PPPPLL"));
    }



    };

    public User validateLoginDetails(List<String> loginDetails){

          if(registeredUser.containsKey(loginDetails.get(0))){

              User user=registeredUser.get(loginDetails.get(0));
              if(user.getPassword().equals(loginDetails.get(1))){
                  return user ;

              }
          }
          return null;
    }


}
